#ifdef FSHIGHPRECISION
	precision highp float;
#else
	precision mediump float;
#endif

//precision highp float;
varying vec2 v_texcoord;
uniform sampler2D texture;
uniform float alpha;
uniform vec4 u_TexRange;
uniform vec2 u_offset;

#import?BLUR_FILTER  "parts/BlurFilter_ps_uniform.glsl";

#import?COLOR_FILTER "parts/ColorFilter.glsl" with ColorFilter_ps_uniform;

#import?GLOW_FILTER "parts/GlowFilter_ps_uniform.glsl";

#import?COLOR_ADD "parts/ColorAdd.glsl" with ColorAdd_ps_uniform;

void main() {
   vec2 newTexCoord;
   newTexCoord.x = mod(u_offset.x + v_texcoord.x,u_TexRange.y) + u_TexRange.x;
   newTexCoord.y = mod(u_offset.y + v_texcoord.y,u_TexRange.w) + u_TexRange.z;
   vec4 color= texture2D(texture, newTexCoord);
   color.a*=alpha;
   gl_FragColor=color;
   
   #import?COLOR_ADD "parts/ColorAdd.glsl" with ColorAdd_ps_logic;
   
   #import?BLUR_FILTER  "parts/BlurFilter_ps_logic.glsl";
   
   #import?COLOR_FILTER "parts/ColorFilter.glsl" with ColorFilter_ps_logic;
   
   #import?GLOW_FILTER "parts/GlowFilter_ps_logic.glsl";
}